<template>
  <div class="gallarybox" @click="handleGallaryShow">
    <div class="wrapper">
      <swiper :options="swiperOption" class="swiperimg">
        <swiper-slide v-for="(item, index) of imgs" :key='index'>
          <img :src="item" alt="">
        </swiper-slide>
        <div class="swiper-pagination extend"  slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: 'commmonGallary',
  props: {
    showGallary: String,
    imgs: {
      type: Array,
      default () {
        return []
      }
    }
  },
  data: function () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observer: true,
        observeParents: true
      }
    }
  },
  methods: {
    handleGallaryShow () {
      this.$emit('close')
    }
  }
}
</script>

<style lang="stylus" scoped>
@import "~@/assets/style/varible.styl"
.gallarybox >>>.swiper-pagination-current
    font-size .24rem
    color $fontbase01
.gallarybox >>>.swiper-pagination-total
     font-size .24rem
     color $fontbase01
.gallarybox
  z-index 9
  display flex
  flex-direction column
  justify-content center
  position fixed
  top 0
  left 0
  right 0
  bottom 0
  background $coler-black
  .wrapper
    /*overflow hidden*/
    width 100%
    height 0
    padding-bottom 100%
    img
      width 100%
      height auto
.swiper-pagination
  &.extend
    position static
    font-size .24rem
    color $fontbase01
    .swiper-pagination-current
      font-size .24rem
      color $fontbase01
    .swiper-pagination-total
      font-size .24rem !important
      color $fontbase01
</style>
